/**
 * @license
 * Copyright 2024 The Model Explorer Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ==============================================================================
 */

.container {
  .mat-icon-container {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.85;

    &:hover {
      opacity: 1;
    }

    mat-icon {
      font-size: 20px;
      width: 20px;
      height: 20px;
    }
  }
}

::ng-deep .model-explorer-view-popup {
  padding: 12px;
  padding-top: 10px;
  font-size: 12px;
  color: var(--me-on-surface-color);
  background-color: var(--me-surface-container-low-color);
  display: flex;
  flex-direction: column;

  .label {
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;

    &:not(:first-child) {
      margin-top: 12px;
    }

    .icon-container {
      cursor: pointer;
      opacity: 0.7;
      display: flex;
      align-items: center;
      justify-content: center;

      &:hover {
        opacity: 1;
      }
    }

    mat-icon {
      font-size: 20px;
      width: 20px;
      height: 20px;
      color: var(--me-on-surface-variant-color);
    }
  }

  .show-on-node-item {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: var(--me-on-surface-variant-color);
    user-select: none;

    input[type='checkbox'] {
      cursor: pointer;
    }

    input[type='radio'] {
      margin-bottom: 4px;
      cursor: pointer;
    }
  }

  .show-on-node-filter {
    margin: 1px 0 4px 25px;
    display: flex;
    align-items: center;
    position: relative;

    &:focus-within .icon-container.ok {
      visibility: visible;
    }

    &.on-edge {
      margin-right: 20px;

      .icon-container.ok {
        right: 6px;
      }
    }

    input {
      flex-grow: 1;
      box-sizing: border-box;
      border: 1px solid var(--me-outline-color);
      border-radius: 3px;
      padding: 3px 26px 3px 4px;
      width: 200px;

      &::placeholder {
        color: var(--me-on-surface-low-color);
      }
    }

    .icon-container {
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0.8;
      cursor: pointer;
      margin-left: 4px;

      &:hover {
        opacity: 1;
      }

      &.ok {
        position: absolute;
        right: 26px;
        visibility: hidden;
      }

      mat-icon {
        font-size: 16px;
        width: 16px;
        height: 16px;
        color: var(--me-on-surface-variant-color);
      }
    }
  }
}

::ng-deep .model-explorer-view-on-node-help-popup {
  padding: 12px;
  font-size: 12px;
  color: var(--me-on-surface-color);
  background-color: var(--me-surface-container-low-color);

  ul {
    margin-block-end: 0;
  }

  .code {
    display: inline-block;
    background-color: var(--me-surface-container-high-color);
    font-family: monospace;

    &.regex {
      background-color: var(--me-warning-container-color);
    }
  }
}

::ng-deep
  .cdk-overlay-container:has(.model-explorer-view-popup)
  .cdk-overlay-backdrop {
  pointer-events: none;
}
